Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override refactor + override in charts + override in Watch #219

Closed
wants to merge 28 commits into from

Conversation

avouspierre
Copy link
Contributor

@avouspierre avouspierre commented May 19, 2024

The PR includes a large refactoring of the swift part of override/profile functions :

  • Override is stored in override core data, including history
  • Override preset is stored in overridepreset core data
  • Add the display of the override in main graph
  • allows to select a override preset (or a temp target) in AW
  • allows to cancel a current override preset or specific override (idem for temp target) in AW
  • add a color profil for override profil in AW
  • Fix some minor code in AW
  • add the upload of override as a exercice in Nightscout - Fix [feature request] Display profiles/overrides in Nightscout  #145
  • improve the management of indefinate override / stop of indefinate override
  • modify the code to respect the Ivan’s patterns of the app :
  • Use of swiftInject (dependency injection) with the use of protocol class in the code
  • Use of MVP principes, in particular not use of direct coredata in view class
  • Use of a proxy model class between coredata and the app to manage changes of core data
  • Use of the pattern of observe to refresh data/view/uploads
  • add a core data unit tests allowing to add tests for coredata with a in-memory datastore for tests.
  • test for overrideStorage available

This PR do NOT change the logic with oref and the interface of override informations in oref. This PR do NOT require a update of trio-oref code.

TODO : Changes the shortcuts after merging with PR #144 and add watch for overrides.

The PR replaces the PR #178 with the functionality for Apple Watch.

override display override in NS
Simulator Screenshot - iPhone 15 - 2024-05-07 at 21 43 34 CleanShot 2024-05-07 at 21 44 16
CleanShot 2024-05-19 at 20 47 23 CleanShot 2024-05-19 at 20 50 17

The PR includes a large refactoring of the swift part of override/profile functions :
- Override is stored in override core data, including history
- Override preset is stored in overridepreset core data
- Add the display of the override in main graph
- add the upload of override as a exercice in Nightscout - Fix nightscout#145
- improve the management of indefinate override / stop of indefinate override
- modify the code to respect the Ivan’s patterns of the app :
     - Use of swiftInject (dependency injection) with the use of protocol class in the code
     - Use of MVP principes, in particular not use of direct coredata in view class
     - Use of a proxy model class between coredata and the app to manage changes of core data
     - Use of the pattern of observe to refresh data/view/uploads

- add a core data unit tests allowing to add tests for coredata with a in-memory datastore for tests.
- test for overrideStorage available

This PR do NOT change the logic with oref and the interface of override informations in oref. This PR do NOT require a update of trio-oref code.

TODO : Changes the shortcuts after merging with PR nightscout#144  and add watch for overrides.
The PR includes a large refactoring of the swift part of override/profile functions :
- Override is stored in override core data, including history
- Override preset is stored in overridepreset core data
- Add the display of the override in main graph
- add the upload of override as a exercice in Nightscout - Fix nightscout#145
- improve the management of indefinate override / stop of indefinate override
- modify the code to respect the Ivan’s patterns of the app :
     - Use of swiftInject (dependency injection) with the use of protocol class in the code
     - Use of MVP principes, in particular not use of direct coredata in view class
     - Use of a proxy model class between coredata and the app to manage changes of core data
     - Use of the pattern of observe to refresh data/view/uploads

- add a core data unit tests allowing to add tests for coredata with a in-memory datastore for tests.
- test for overrideStorage available

This PR do NOT change the logic with oref and the interface of override informations in oref. This PR do NOT require a update of trio-oref code.

TODO : Changes the shortcuts after merging with PR nightscout#144  and add watch for overrides.
The PR includes a large refactoring of the swift part of override/profile functions :
- Override is stored in override core data, including history
- Override preset is stored in overridepreset core data
- Add the display of the override in main graph
- add the upload of override as a exercice in Nightscout - Fix nightscout#145
- improve the management of indefinate override / stop of indefinate override
- modify the code to respect the Ivan’s patterns of the app :
     - Use of swiftInject (dependency injection) with the use of protocol class in the code
     - Use of MVP principes, in particular not use of direct coredata in view class
     - Use of a proxy model class between coredata and the app to manage changes of core data
     - Use of the pattern of observe to refresh data/view/uploads

- add a core data unit tests allowing to add tests for coredata with a in-memory datastore for tests.
- test for overrideStorage available

This PR do NOT change the logic with oref and the interface of override informations in oref. This PR do NOT require a update of trio-oref code.

TODO : Changes the shortcuts after merging with PR nightscout#144  and add watch for overrides.
fix when preset has no id
Add override options for apple watch inside the temp target menu.

- allows to select a override preset (or a temp target)
- allows to cancel a current override preset or specific override (idem for temp target)
- add a color profil for override profil
- Fix some minor code
@mountrcg
Copy link
Contributor

mountrcg commented May 20, 2024

@avouspierre could there be a function that for at least a timewise unrestricted override to copy the new basal profile to the pump?
Of course that needs another copy to pump call when override is cancelled!

use async to update overrideObserver.
dsnallfot and others added 15 commits May 25, 2024 18:29
- One more click to reach the service, but
- Added chevron in settings list (for consistency)
- Added room for information/explainations of the setting in header/footer in the new view
- First draft to build on (maybe: rephrase header/footer, add connection status in navigation view, other relevant info etc)
- Footer text in 2 elements
- spelling error fix
 and Connect to Tidepool from ontapgesture text ->  Action button with blue text for consistency
- Sheet needed to be moved outside Form (Swift curiosity)
Treatments: Carbs and Temp Targets - and also announcements
- Imroved structure and UX workflow when configuring Nightscout settings
- Added Connect, Upload, Fetch views with relevant settings per view
- Import settings and backfill glucose buttons kept in rootview since they are more frequently used
- Added footers for many sections to explain what the toggles actually do
- Loacalizaation needed for new textstrings. Just updated that with small changes in already existing strings
- Break up long strings in several text elements (enables re-use of some already existing translations)
- Change button text "Connect" to "Connect to Nightscout" in NightscoutConnectView
avouspierre and others added 7 commits May 25, 2024 18:35
Display the eventual Pump Statut Highlight Message in home view if state is warning or critical.

fix partially issue nightscout#207
Change statut to status variable and function
The PR includes a large refactoring of the swift part of override/profile functions :
- Override is stored in override core data, including history
- Override preset is stored in overridepreset core data
- Add the display of the override in main graph
- add the upload of override as a exercice in Nightscout - Fix nightscout#145
- improve the management of indefinate override / stop of indefinate override
- modify the code to respect the Ivan’s patterns of the app :
     - Use of swiftInject (dependency injection) with the use of protocol class in the code
     - Use of MVP principes, in particular not use of direct coredata in view class
     - Use of a proxy model class between coredata and the app to manage changes of core data
     - Use of the pattern of observe to refresh data/view/uploads

- add a core data unit tests allowing to add tests for coredata with a in-memory datastore for tests.
- test for overrideStorage available

This PR do NOT change the logic with oref and the interface of override informations in oref. This PR do NOT require a update of trio-oref code.

TODO : Changes the shortcuts after merging with PR nightscout#144  and add watch for overrides.
Fix a issue when you want to extend a current preset.
Add edit based on PR nightscout#235
Reduce the call of coredata for override when a observer is executed
Reduce the observer update
@dnzxy
Copy link
Contributor

dnzxy commented May 26, 2024

This PR seems to be under active development and has elements that collide with #235 and #236 respectively. May I make two proposals:

  1. Let’s put this in Draft mode for now until both the linked PRs are done and we know how the UX will be like before you refactor this.
  2. Split this PR so that all elements that regard the watch app for Trio are in a second PR. This PR is really big and hard to review now.

@avouspierre
Copy link
Contributor Author

This PR seems to be under active development and has elements that collide with #235 and #236 respectively. May I make two proposals:

  1. Let’s put this in Draft mode for now until both the linked PRs are done and we know how the UX will be like before you refactor this.
  2. Split this PR so that all elements that regard the watch app for Trio are in a second PR. This PR is really big and hard to review now.

OK. I create new PR with different splits.

mountrcg pushed a commit to mountrcg/Trio that referenced this pull request Aug 1, 2024
* Add SMB flag and robot emoji for SMB boluses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] Display profiles/overrides in Nightscout
7 participants